﻿using System.Windows.Forms;
using FarmerJoe.Settings;
using Styx;

namespace FarmerJoe
{
    public partial class uiForm1 : Form
    {
        public uiForm1(){InitializeComponent();}

        private void uiForm1_Load(object sender, System.EventArgs e)
        {
            SuspendLayout();
            lblClass.Text = StyxWoW.Me.Class.ToString();

            switch (StyxWoW.Me.Class)
            {
                case WoWClass.Warlock:
                    FpswareSettings.Instance.Warlock.Load();
                    pnlClassSettingsHolder.Controls.Add(new ucWarlockSetting());
                    this.Text = "Fpsware Warlock: Shadow Walker";
                    break;

                case WoWClass.Hunter:
                    FpswareSettings.Instance.Hunter.Load();
                    pnlClassSettingsHolder.Controls.Add(new ucHunterSetting());
                    this.Text = "Fpsware Hunter: Beast Lord";
                    break;

                case WoWClass.Druid:
                    FpswareSettings.Instance.Druid.Load();
                    pnlClassSettingsHolder.Controls.Add(new ucDruidSetting());
                    this.Text = "Fpsware Druid: Shapeshifter";
                    break;

                default:
                    pnlClassSettingsHolder.Controls.Add(new ucNoSettings());
                    break;
            }

            
            ResumeLayout();
        }


        private void btnSave_Click(object sender, System.EventArgs e)
        {
            switch (StyxWoW.Me.Class)
            {
                case WoWClass.Warlock:
                    FpswareSettings.Instance.Warlock.Save();
                    break;
                    
                case WoWClass.Druid:
                    FpswareSettings.Instance.Druid.Save();
                    break;

                case WoWClass.Hunter:
                    FpswareSettings.Instance.Hunter.Save();
                    break;

                default:
                    break;
            }
            Close();
        }
    }
}
